﻿<%@ Page Language="C#" MasterPageFile="~/Main.master" AutoEventWireup="true" CodeFile="Products.aspx.cs" Inherits="Products" Title="Untitled Page" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <asp:ListView ID="ListView1" runat="server" DataSourceID="SqlDataSource1">
        <AlternatingItemTemplate>
            <li style="background-color: #FAFAD2;color: #284775;">productId:
                <asp:Label ID="productIdLabel" runat="server" Text='<%# Eval("productId") %>' />
                <br />
                name:
                <asp:Label ID="nameLabel" runat="server" Text='<%# Eval("name") %>' />
                <br />
                descr:
                <asp:Label ID="descrLabel" runat="server" Text='<%# Eval("descr") %>' />
                <br />
                price:
                <asp:Label ID="priceLabel" runat="server" Text='<%# Eval("price") %>' />
                <br />
                imageFile:
                <asp:Label ID="imageFileLabel" runat="server" Text='<%# Eval("imageFile") %>' />
                <br />
            </li>
        </AlternatingItemTemplate>
        <LayoutTemplate>
            <ul ID="itemPlaceholderContainer" runat="server" 
                style="font-family: Verdana, Arial, Helvetica, sans-serif;">
                <li ID="itemPlaceholder" runat="server" />
                </ul>
                <div style="text-align: center;background-color: #FFCC66;font-family: Verdana, Arial, Helvetica, sans-serif;color: #333333;">
                </div>
            </LayoutTemplate>
            <InsertItemTemplate>
                <li style="">name:
                    <asp:TextBox ID="nameTextBox" runat="server" Text='<%# Bind("name") %>' />
                    <br />
                    descr:
                    <asp:TextBox ID="descrTextBox" runat="server" Text='<%# Bind("descr") %>' />
                    <br />
                    price:
                    <asp:TextBox ID="priceTextBox" runat="server" Text='<%# Bind("price") %>' />
                    <br />
                    imageFile:
                    <asp:TextBox ID="imageFileTextBox" runat="server" 
                        Text='<%# Bind("imageFile") %>' />
                    <br />
                    <asp:Button ID="InsertButton" runat="server" CommandName="Insert" 
                        Text="Insert" />
                    <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" 
                        Text="Clear" />
                </li>
            </InsertItemTemplate>
            <SelectedItemTemplate>
                <li style="background-color: #FFCC66;font-weight: bold;color: #000080;">productId:
                    <asp:Label ID="productIdLabel" runat="server" Text='<%# Eval("productId") %>' />
                    <br />
                    name:
                    <asp:Label ID="nameLabel" runat="server" Text='<%# Eval("name") %>' />
                    <br />
                    descr:
                    <asp:Label ID="descrLabel" runat="server" Text='<%# Eval("descr") %>' />
                    <br />
                    price:
                    <asp:Label ID="priceLabel" runat="server" Text='<%# Eval("price") %>' />
                    <br />
                    imageFile:
                    <asp:Label ID="imageFileLabel" runat="server" Text='<%# Eval("imageFile") %>' />
                    <br />
                </li>
            </SelectedItemTemplate>
            <EmptyDataTemplate>
                No data was returned.
            </EmptyDataTemplate>
            <EditItemTemplate>
                <li style="background-color: #FFCC66;color: #000080;">productId:
                    <asp:Label ID="productIdLabel1" runat="server" 
                        Text='<%# Eval("productId") %>' />
                    <br />
                    name:
                    <asp:TextBox ID="nameTextBox" runat="server" Text='<%# Bind("name") %>' />
                    <br />
                    descr:
                    <asp:TextBox ID="descrTextBox" runat="server" Text='<%# Bind("descr") %>' />
                    <br />
                    price:
                    <asp:TextBox ID="priceTextBox" runat="server" Text='<%# Bind("price") %>' />
                    <br />
                    imageFile:
                    <asp:TextBox ID="imageFileTextBox" runat="server" 
                        Text='<%# Bind("imageFile") %>' />
                    <br />
                    <asp:Button ID="UpdateButton" runat="server" CommandName="Update" 
                        Text="Update" />
                    <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" 
                        Text="Cancel" />
                </li>
            </EditItemTemplate>
            <ItemTemplate>
                <li style="background-color: #FFFBD6;color: #333333;">productId:
                    <asp:Label ID="productIdLabel" runat="server" Text='<%# Eval("productId") %>' />
                    <br />
                    name:
                    <asp:Label ID="nameLabel" runat="server" Text='<%# Eval("name") %>' />
                    <br />
                    descr:
                    <asp:Label ID="descrLabel" runat="server" Text='<%# Eval("descr") %>' />
                    <br />
                    price:
                    <asp:Label ID="priceLabel" runat="server" Text='<%# Eval("price") %>' />
                    <br />
                    imageFile:
                    <asp:Label ID="imageFileLabel" runat="server" Text='<%# Eval("imageFile") %>' />
                    <br />
                </li>
            </ItemTemplate>
            <ItemSeparatorTemplate>
                <br />
            </ItemSeparatorTemplate>
</asp:ListView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" 
    ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
    SelectCommand="SELECT * FROM [Product]"></asp:SqlDataSource>
</asp:Content>

